//
//  Hospital.m
//  Doctor1.0
//
//  Created by mk on 15/5/30.
//  Copyright (c) 2015年 cocoa-mk. All rights reserved.
//

#import "Hospital.h"

@implementation HospitalInfo

-(id)init
{
    if (self = [super init])
    {
        self.urlPath = @"";
        self.strDataKey = requestDataKey;
    }
    return self;
}

-(void)parseData:(id)dataObj
{
    [super parseData:dataObj];
    
    if ([dataObj isKindOfClass:[NSDictionary class]])
    {
        self.hos_ID = NullObjToString(dataObj[@"id"]);
        self.hos_name =  NullObjToString(dataObj[@"name"]);
        self.hos_hpClass = NullObjToString(dataObj[@"hpClass"]);
        self.hos_hpType = NullObjToString(dataObj[@"hpType"]);
        self.hos_imageUrl = NullObjToString(dataObj[@"imageUrl"]);
        self.hos_phone = NullObjToString(dataObj[@"phone"]);

    }
}


@end


@implementation HospitalList

-(id)init
{
    if (self = [super init])
    {
        self.urlPath = @"";
        self.strDataKey = requestDataKey;
    }
    return self;
}

-(void)parseData:(id)dataObj
{
    [super parseData:dataObj];
    
    if ([dataObj isKindOfClass:[NSArray class]])
    {
        for (int i = 0; i < [dataObj count]; i++) {
            NSDictionary *dicRec = [dataObj objectAtIndex:i];
            HospitalInfo *recData = [[HospitalInfo alloc] init];
            [recData parseData:dicRec];
            [self.dataArray addObject:recData];
        }
    }
}

@end




